
get_filename_component(tarName ${CMAKE_CURRENT_SOURCE_DIR} NAME)

add_compile_definitions(appName="${CMAKE_PROJECT_NAME}_${tarName}")
set(qrcs "")
file(GLOB_RECURSE files *.h *.hpp *.cpp *.c)

if (CMAKE_BUILD_TYPE MATCHES "Release")
    file(GLOB_RECURSE qrcs *.qrc)
    add_compile_definitions(qmlPath="qrc:/")
else()
    add_compile_definitions(qmlPath="file:///${CMAKE_CURRENT_SOURCE_DIR}/")
    set(tarName ${tarName}_debug)    
endif()

add_executable(${tarName} ${files} ${qrcs})
# target_include_directories(${tarName} PUBLIC . ../shared)
# target_compile_definitions(${tarName} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(${tarName} PUBLIC
    Qt::Core
    Qt::Gui
    Qt::Qml
    Qt::Quick
    Qt::QuickControls2
)

# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Trans/language_zh.json ${EXECUTABLE_OUTPUT_PATH}/Trans/language_zh.json COPYONLY)
